package com.karson.service.service.impl;


import com.karson.common.dto.rabbitmq.StaticMessage;
import com.karson.service.dao.ActionCountsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;



/**
 * @author ZKS
 */
@Component("fav")
public class FavoriteStatisticService extends AbstractStatisticService {

    @Autowired
    private ActionCountsMapper actionCountsMapper;

    @Override
    protected void flushToDatabase(StaticMessage key, long count) {
        actionCountsMapper.incrementFavCount(
                key.getMessageId(),
                count,
                key.getType()
        );
    }
}
